class js:
    def __init__(self, number1, number2):
        self.number1 = number1
        self.number2 = number2


    # 提供两个数字相加
    def add(self):
        res = self.number1 + self.number2
        print(f"和为:{res}")


    # 相减
    def subtract(self):
        res = self.number1 - self.number2
        print(f"差为:{res}")


    # 相乘
    def multiply(self):
        res = self.number1 * self.number2
        print(f"乘积为:{res}")


    # 相除
    # 注意:需要判断除数不能为0
    def divide(self):
        if self.number2 != 0:
            res = self.number1 / self.number2
            print(f"商为:{res}")
        else:
            print("除数不能为0！")
js1 = js(4,2)
js1.add()